home *** CD-ROM | disk | FTP | other *** search
Wrap
; Done by Rajat for AutoHotkey ; ; Script Function: ; Install syntax highlighting and clip library files. ; Add hotkeys to TextPad for Launching Script and Context Sensitive Help RegRead, TextPadDir, HKEY_CLASSES_ROOT, TextPad.tws\shell\open\Command, if TextPadDir = RegRead, TextPadDir, HKEY_CLASSES_ROOT, Applications\TextPad.exe\shell\edit\Command, if TextPadDir = TextPadDir = %programfiles%\TextPad 4 ; Try a best-guess location. else { StringGetPos, TPOS, TextPadDir, TextPad.exe StringLeft, TextPadDir, TextPadDir, %TPOS% StringReplace, TextPadDir, TextPadDir, ", , all ; Remove all double quotes. } IfNotExist, %TextPadDir% { MsgBox, TextPad could not be found (the directory "%TextPadDir%" does not exist).`n`nThis script will now exit. Exit } ; Prompt the user to run the script - use a Yes/No prompt (4 - see help file) MsgBox, 4, TextPad v4, This script will install syntax highlighting and clip library files for TextPad v4. Run? IfMsgBox, NO, Exit FileCopy, AutoHotkey.syn, %TextPadDir%\system, 1 if ErrorLevel <> 0 { MsgBox, Could not copy AutoHotkey.syn Exit } FileCopy, AutoHotkey.tcl, %TextPadDir%\Samples, 1 if ErrorLevel <> 0 { MsgBox, Could not copy AutoHotkey.tcl Exit } ; Now write the reg keys (use the non-abbreviated root key names in case user has an older version of AutoHotkey) RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Document Classes\AutoHotkey, Type, 2 RegWrite, REG_MULTI_SZ, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Document Classes\AutoHotkey, Members, *.ahk RegWrite, REG_BINARY, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Document Classes\AutoHotkey, Properties, 46000000010000000100000001000000 RegWrite, REG_BINARY, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Document Classes\AutoHotkey, Colors, 010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000008006c800010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000008080800001000000 RegWrite, REG_BINARY, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Document Classes\AutoHotkey, SyntaxProps, 01000000 RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Document Classes\AutoHotkey, SyntaxFile, AutoHotkey.syn RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Document Classes\AutoHotkey, WordChars, _ MsgBox, 4, TextPad v4, Installation complete!`n`nDo you want to make TextPad the default editor for AutoHotkey scripts? IfMsgBox, Yes, RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AutoHotkeyScript\Shell\Edit\Command, , "%TextPadDir%\TextPad.exe" "`%1" MsgBox, 4, TextPad v4, Do you want to make 'Ctrl+1' a shortcut for running the script currently loaded in TextPad?`n`n(The shortcut may be reconfigured in TextPad 'Configure Menu > Preferences > KeyBoard') IfMsgBox, Yes { RegWrite, REG_BINARY, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Tools\0, Properties, 000000005680000046000000 RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Tools\0, MenuText, Run Script RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Tools\0, Command, %comspec% RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Tools\0, Parameters, %a_space%/c start $DosFile RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Tools\0, Folder, $FileDir RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Tools\0, RE, } MsgBox, 4, TextPad v4, Do you want to make 'Ctrl+2' a shortcut for context sensitive help in TextPad?`n`n(The shortcut may be reconfigured in TextPad 'Configure Menu > Preferences > KeyBoard') IfMsgBox, Yes { RegRead, AHKPATH, HKEY_CLASSES_ROOT, AutoHotkeyScript\Shell\Run\Command, StringGetPos, POS, AHKPATH, AutoHotkey.exe StringLeft, AHKPATH, AHKPATH, %POS% RegWrite, REG_BINARY, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Tools\1, Properties, 020000005780000004000000 RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Tools\1, MenuText, AutoHotkey Help RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Tools\1, Command, HH.EXE RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Tools\1, Parameters, %ahkpath%AutoHotkey.chm RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Tools\1, Folder, RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Helios\TextPad 4\Tools\1, RE, }